{smcl}
{txt}{sf}{ul off}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\williamslaro\Documents\Research\Projects\Spatial Methods\Spatial-X\Journal of Politics\Replication\Application\Results\Military Spending--Results.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res} 5 Sep 2019, 09:36:52
{txt}
{com}. 
. *******************************************************************************
. ********************************** OLS ****************************************
. *******************************************************************************
. 
. use `data', clear
{txt}
{com}. 
. *** Get rid of the isolates (I create these datasets in "Generate Weights Matrices.do")
. sort year ccode 
{txt}
{com}. merge year ccode using "Data\Weights Matrices\SAR\Contiguity\exclude_cont.dta"
{txt}{p}
(note: you are using old
{bf:merge} syntax; see
{bf:{help merge:[D] merge}} for new syntax)
{p_end}

{com}. drop _merge
{txt}
{com}. drop if numall1 == 0
{txt}(1,074 observations deleted)

{com}. gen id = _n
{txt}
{com}. 
. *** Model 1 (OLS)
. reg ch_milex civilwar_tm1 total_wars_tm1 log_pop_tm1  alliance_us ch_milex_us ch_milex_ussr ally_ch_milex_us ally_ch_milex_us_ussr trend Y42 milex_tm1 ch2_milex  R2 - R5 

{txt}      Source {c |}       SS           df       MS      Number of obs   ={res}     6,328
{txt}{hline 13}{c +}{hline 34}   F(16, 6311)     = {res}    42.96
{txt}       Model {c |} {res} 4298.78631        16  268.674144   {txt}Prob > F        ={res}    0.0000
{txt}    Residual {c |} {res} 39471.5471     6,311  6.25440455   {txt}R-squared       ={res}    0.0982
{txt}{hline 13}{c +}{hline 34}   Adj R-squared   ={res}    0.0959
{txt}       Total {c |} {res} 43770.3334     6,327   6.9180233   {txt}Root MSE        =   {res} 2.5009

{txt}{hline 22}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}             ch_milex{col 23}{c |}      Coef.{col 35}   Std. Err.{col 47}      t{col 55}   P>|t|{col 63}     [95% Con{col 76}f. Interval]
{hline 22}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 9}civilwar_tm1 {c |}{col 23}{res}{space 2}  -.46756{col 35}{space 2}  .167615{col 46}{space 1}   -2.79{col 55}{space 3}0.005{col 63}{space 4}-.7961424{col 76}{space 3}-.1389776
{txt}{space 7}total_wars_tm1 {c |}{col 23}{res}{space 2} .4644379{col 35}{space 2} .1632625{col 46}{space 1}    2.84{col 55}{space 3}0.004{col 63}{space 4}  .144388{col 76}{space 3} .7844878
{txt}{space 10}log_pop_tm1 {c |}{col 23}{res}{space 2}  .026473{col 35}{space 2} .0217519{col 46}{space 1}    1.22{col 55}{space 3}0.224{col 63}{space 4}-.0161682{col 76}{space 3} .0691141
{txt}{space 10}alliance_us {c |}{col 23}{res}{space 2}-.2119585{col 35}{space 2} .0980779{col 46}{space 1}   -2.16{col 55}{space 3}0.031{col 63}{space 4}-.4042246{col 76}{space 3}-.0196924
{txt}{space 10}ch_milex_us {c |}{col 23}{res}{space 2}-.0435318{col 35}{space 2} .0746605{col 46}{space 1}   -0.58{col 55}{space 3}0.560{col 63}{space 4}-.1898917{col 76}{space 3} .1028281
{txt}{space 8}ch_milex_ussr {c |}{col 23}{res}{space 2} .0059248{col 35}{space 2} .0206163{col 46}{space 1}    0.29{col 55}{space 3}0.774{col 63}{space 4}-.0344902{col 76}{space 3} .0463398
{txt}{space 5}ally_ch_milex_us {c |}{col 23}{res}{space 2} .1414619{col 35}{space 2}  .117031{col 46}{space 1}    1.21{col 55}{space 3}0.227{col 63}{space 4}-.0879587{col 76}{space 3} .3708825
{txt}ally_ch_milex_us_ussr {c |}{col 23}{res}{space 2} .0045288{col 35}{space 2} .0292293{col 46}{space 1}    0.15{col 55}{space 3}0.877{col 63}{space 4}-.0527706{col 76}{space 3} .0618283
{txt}{space 16}trend {c |}{col 23}{res}{space 2}-.0070512{col 35}{space 2} .0021163{col 46}{space 1}   -3.33{col 55}{space 3}0.001{col 63}{space 4}   -.0112{col 76}{space 3}-.0029025
{txt}{space 18}Y42 {c |}{col 23}{res}{space 2} 1.129879{col 35}{space 2} .2807812{col 46}{space 1}    4.02{col 55}{space 3}0.000{col 63}{space 4} .5794526{col 76}{space 3} 1.680306
{txt}{space 12}milex_tm1 {c |}{col 23}{res}{space 2}-.1210728{col 35}{space 2} .0062606{col 46}{space 1}  -19.34{col 55}{space 3}0.000{col 63}{space 4}-.1333457{col 76}{space 3}   -.1088
{txt}{space 12}ch2_milex {c |}{col 23}{res}{space 2}-.1418088{col 35}{space 2} .0121803{col 46}{space 1}  -11.64{col 55}{space 3}0.000{col 63}{space 4}-.1656862{col 76}{space 3}-.1179313
{txt}{space 19}R2 {c |}{col 23}{res}{space 2} .3601437{col 35}{space 2} .1069424{col 46}{space 1}    3.37{col 55}{space 3}0.001{col 63}{space 4} .1505002{col 76}{space 3} .5697873
{txt}{space 19}R3 {c |}{col 23}{res}{space 2}-.1859642{col 35}{space 2}  .096569{col 46}{space 1}   -1.93{col 55}{space 3}0.054{col 63}{space 4}-.3752723{col 76}{space 3} .0033439
{txt}{space 19}R4 {c |}{col 23}{res}{space 2}-.0296389{col 35}{space 2} .1098771{col 46}{space 1}   -0.27{col 55}{space 3}0.787{col 63}{space 4}-.2450353{col 76}{space 3} .1857574
{txt}{space 19}R5 {c |}{col 23}{res}{space 2}-.1271522{col 35}{space 2} .1072542{col 46}{space 1}   -1.19{col 55}{space 3}0.236{col 63}{space 4}-.3374069{col 76}{space 3} .0831025
{txt}{space 16}_cons {c |}{col 23}{res}{space 2} .4634912{col 35}{space 2} .2156237{col 46}{space 1}    2.15{col 55}{space 3}0.032{col 63}{space 4} .0407955{col 76}{space 3} .8861869
{txt}{hline 22}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
. 
. *******************************************************************************
. ********************************** SAR ****************************************
. *******************************************************************************
. 
. *** Get the weights matrix ready (contiguous, non-row-standardized)
. preserve
{txt}
{com}.         use "Data\Weights Matrices\SAR\Contiguity\W.dta", clear
{txt}
{com}.         mkmat cont*, matrix(W)
{res}{txt}
{com}.         mata: Wcont = st_matrix("W")
{res}{txt}
{com}.         gen id = _n
{txt}
{com}.         cap spmat drop w
{txt}
{com}.         spmat dta w cont*, id(id)
{res}{txt}
{com}. restore
{txt}
{com}. 
. *** Estimate the SAR (note that the spatial autocorrelation coefficient, rho, is called "lambda" here)
. *** Model 2 (SAR)
. spreg ml ch_milex civilwar_tm1 total_wars_tm1 log_pop_tm1 alliance_us ch_milex_us ch_milex_ussr ally_ch_milex_us ally_ch_milex_us_ussr /*
> */      trend Y42 R2 - R5 milex_tm1 ch2_milex, id(id) dlmat(w, eig)
{res}
{txt}Performing a grid search.... {txt}finished

Iteration 0:{space 3}log likelihood = {res:-14657.762}  
Iteration 1:{space 3}log likelihood = {res:-14627.008}  
Iteration 2:{space 3}log likelihood = {res:    -14627}  
Iteration 3:{space 3}log likelihood = {res:    -14627}  
{txt}
Optimizing unconcentrated log likelihood

Iteration 0:{space 3}log likelihood = {res:    -14627}  

Spatial autoregressive model {col 51}Number of obs {col 67}= {res}    6328
{txt}(Maximum likelihood estimates){col 51}Wald chi2({res}16{txt}){col 67}= {res} 649.073
{txt}{col 51}Prob > chi2{col 67}= {res}  0.0000

{txt}{hline 22}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}             ch_milex{col 23}{c |}      Coef.{col 35}   Std. Err.{col 47}      z{col 55}   P>|z|{col 63}     [95% Con{col 76}f. Interval]
{hline 22}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}ch_milex              {txt}{c |}
{space 9}civilwar_tm1 {c |}{col 23}{res}{space 2}-.4482446{col 35}{space 2}  .161989{col 46}{space 1}   -2.77{col 55}{space 3}0.006{col 63}{space 4}-.7657373{col 76}{space 3}-.1307519
{txt}{space 7}total_wars_tm1 {c |}{col 23}{res}{space 2} .4528503{col 35}{space 2} .1577804{col 46}{space 1}    2.87{col 55}{space 3}0.004{col 63}{space 4} .1436064{col 76}{space 3} .7620943
{txt}{space 10}log_pop_tm1 {c |}{col 23}{res}{space 2} .0285094{col 35}{space 2} .0210217{col 46}{space 1}    1.36{col 55}{space 3}0.175{col 63}{space 4}-.0126923{col 76}{space 3} .0697111
{txt}{space 10}alliance_us {c |}{col 23}{res}{space 2}-.2153326{col 35}{space 2} .0947841{col 46}{space 1}   -2.27{col 55}{space 3}0.023{col 63}{space 4} -.401106{col 76}{space 3}-.0295593
{txt}{space 10}ch_milex_us {c |}{col 23}{res}{space 2} -.029857{col 35}{space 2}  .072157{col 46}{space 1}   -0.41{col 55}{space 3}0.679{col 63}{space 4} -.171282{col 76}{space 3} .1115681
{txt}{space 8}ch_milex_ussr {c |}{col 23}{res}{space 2} -.010335{col 35}{space 2} .0199446{col 46}{space 1}   -0.52{col 55}{space 3}0.604{col 63}{space 4}-.0494257{col 76}{space 3} .0287557
{txt}{space 5}ally_ch_milex_us {c |}{col 23}{res}{space 2} .1090514{col 35}{space 2} .1131149{col 46}{space 1}    0.96{col 55}{space 3}0.335{col 63}{space 4}-.1126497{col 76}{space 3} .3307525
{txt}ally_ch_milex_us_ussr {c |}{col 23}{res}{space 2} .0092474{col 35}{space 2} .0282489{col 46}{space 1}    0.33{col 55}{space 3}0.743{col 63}{space 4}-.0461194{col 76}{space 3} .0646141
{txt}{space 16}trend {c |}{col 23}{res}{space 2}-.0057506{col 35}{space 2} .0020465{col 46}{space 1}   -2.81{col 55}{space 3}0.005{col 63}{space 4}-.0097617{col 76}{space 3}-.0017395
{txt}{space 18}Y42 {c |}{col 23}{res}{space 2} .7424706{col 35}{space 2} .2722129{col 46}{space 1}    2.73{col 55}{space 3}0.006{col 63}{space 4} .2089432{col 76}{space 3} 1.275998
{txt}{space 19}R2 {c |}{col 23}{res}{space 2} .3084063{col 35}{space 2} .1033911{col 46}{space 1}    2.98{col 55}{space 3}0.003{col 63}{space 4} .1057635{col 76}{space 3} .5110491
{txt}{space 19}R3 {c |}{col 23}{res}{space 2}-.2181757{col 35}{space 2}  .093343{col 46}{space 1}   -2.34{col 55}{space 3}0.019{col 63}{space 4}-.4011246{col 76}{space 3}-.0352267
{txt}{space 19}R4 {c |}{col 23}{res}{space 2}-.0398713{col 35}{space 2} .1061882{col 46}{space 1}   -0.38{col 55}{space 3}0.707{col 63}{space 4}-.2479965{col 76}{space 3} .1682538
{txt}{space 19}R5 {c |}{col 23}{res}{space 2}-.1349978{col 35}{space 2} .1036529{col 46}{space 1}   -1.30{col 55}{space 3}0.193{col 63}{space 4}-.3381537{col 76}{space 3} .0681581
{txt}{space 12}milex_tm1 {c |}{col 23}{res}{space 2}-.1161248{col 35}{space 2} .0060566{col 46}{space 1}  -19.17{col 55}{space 3}0.000{col 63}{space 4}-.1279955{col 76}{space 3} -.104254
{txt}{space 12}ch2_milex {c |}{col 23}{res}{space 2}-.1320264{col 35}{space 2} .0117838{col 46}{space 1}  -11.20{col 55}{space 3}0.000{col 63}{space 4}-.1551223{col 76}{space 3}-.1089305
{txt}{space 16}_cons {c |}{col 23}{res}{space 2} .4068175{col 35}{space 2} .2084058{col 46}{space 1}    1.95{col 55}{space 3}0.051{col 63}{space 4}-.0016503{col 76}{space 3} .8152854
{txt}{hline 22}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}lambda                {txt}{c |}
{space 16}_cons {c |}{col 23}{res}{space 2} .0708395{col 35}{space 2} .0039583{col 46}{space 1}   17.90{col 55}{space 3}0.000{col 63}{space 4} .0630813{col 76}{space 3} .0785977
{txt}{hline 22}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}sigma2                {txt}{c |}
{space 16}_cons {c |}{col 23}{res}{space 2} 5.841337{col 35}{space 2} .1047864{col 46}{space 1}   55.75{col 55}{space 3}0.000{col 63}{space 4} 5.635959{col 76}{space 3} 6.046714
{txt}{hline 22}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. mat beta = e(b)
{txt}
{com}. scalar obs = e(N)
{txt}
{com}. matrix I = I(obs)
{txt}
{com}. mata: beta = st_matrix("beta")
{res}{txt}
{com}. mata: I = st_matrix("I")
{res}{txt}
{com}. 
. *** Substantive effects (Supplemental Materials)
. * Civil war
. mata: pd = luinv(I-beta[1,18]*Wcont)*beta[1,1]
{res}{txt}
{com}. mata: deffect = 1/rows(Wcont)*trace(pd)
{res}{txt}
{com}. mata: teffect = 1/rows(Wcont)*sum(pd)
{res}{txt}
{com}. mata: ieffect = 1/rows(Wcont)*(sum(pd)-trace(pd))
{res}{txt}
{com}. 
. mata: deffect
{res}  -.4578573573
{txt}
{com}. mata: ieffect
{res}  -.1660440814
{txt}
{com}. mata: teffect
{res}  -.6239014387
{txt}
{com}. 
. * Interstate war
. mata: pd = luinv(I-beta[1,18]*Wcont)*beta[1,2]
{res}{txt}
{com}. mata: deffect = 1/rows(Wcont)*trace(pd)
{res}{txt}
{com}. mata: teffect = 1/rows(Wcont)*sum(pd)
{res}{txt}
{com}. mata: ieffect = 1/rows(Wcont)*(sum(pd)-trace(pd))
{res}{txt}
{com}. 
. mata: deffect
{res}  .4625618435
{txt}
{com}. mata: ieffect
{res}  .167750185
{txt}
{com}. mata: teffect
{res}  .6303120284
{txt}
{com}. 
. * Military expenditures
. mata: pd = luinv(I-beta[1,18]*Wcont)*beta[1,15]
{res}{txt}
{com}. mata: deffect = 1/rows(Wcont)*trace(pd)
{res}{txt}
{com}. mata: teffect = 1/rows(Wcont)*sum(pd)
{res}{txt}
{com}. mata: ieffect = 1/rows(Wcont)*(sum(pd)-trace(pd))
{res}{txt}
{com}. 
. mata: deffect
{res}  -.1186150985
{txt}
{com}. mata: ieffect
{res}  -.0430163123
{txt}
{com}. mata: teffect
{res}  -.1616314109
{txt}
{com}. 
. 
. *******************************************************************************
. ********************************** SLX ****************************************
. *******************************************************************************
. 
. *** Get the data ready
. use "Data\Military Spending--Monadic--SLX.dta", clear
{txt}
{com}. 
. gen trend = year - 1949
{txt}
{com}. gen dem = cond(polity >= 6, 1, 0)
{txt}
{com}. gen ally_ch_milex_us = alliance_us * ch_milex_us
{txt}
{com}. gen ally_ch_milex_us_ussr = alliance_us * ch_milex_ussr
{txt}
{com}. gen ally_ch_milex_ussr = alliance_ussr * ch_milex_ussr
{txt}
{com}. 
. lab def region_l 1 "Europe" 2 "North Africa/Middle East" 3 "Africa" 4 "Asia/Oceania" 5 "North/Central/South America"
{txt}
{com}. lab val region region_l
{txt}
{com}. 
. qui {c -(}
{txt}
{com}. 
. *** Generate some region-specific SLX variables
. foreach r of numlist 1(1)5 {c -(} 
{txt}  2{com}.         gen W_region`r'_war_tm1 = R`r' * W_region_war_tm1
{txt}  3{com}.         gen W_region`r'_civilwar_tm1 = R`r' * W_region_civilwar_tm1
{txt}  4{com}. {c )-}
{txt}
{com}. 
. sort ccode year
{txt}
{com}. bys ccode: gen ch2_milex = milex[_n-1] - milex[_n-2]
{txt}(395 missing values generated)

{com}. sort year ccode
{txt}
{com}. 
. *** Model 3 (SLX)
. reg ch_milex W_cont_civilwar_tm1 W_cont_war_tm1 W_ally_war_tm1 W_cont_milex_tm1 W_def_milex_tm1 /*
> */      civilwar_tm1 total_wars_tm1 log_pop_tm1 alliance_us ch_milex_us ch_milex_ussr ally_ch_milex_us ally_ch_milex_us_ussr trend Y42 /*
> */      milex_tm1 ch2_milex R2 - R5

{txt}      Source {c |}       SS           df       MS      Number of obs   ={res}     7,266
{txt}{hline 13}{c +}{hline 34}   F(21, 7244)     = {res}    43.39
{txt}       Model {c |} {res} 4848.29654        21  230.871264   {txt}Prob > F        ={res}    0.0000
{txt}    Residual {c |} {res} 38544.4479     7,244  5.32087905   {txt}R-squared       ={res}    0.1117
{txt}{hline 13}{c +}{hline 34}   Adj R-squared   ={res}    0.1092
{txt}       Total {c |} {res} 43392.7444     7,265  5.97284851   {txt}Root MSE        =   {res} 2.3067

{txt}{hline 22}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}             ch_milex{col 23}{c |}      Coef.{col 35}   Std. Err.{col 47}      t{col 55}   P>|t|{col 63}     [95% Con{col 76}f. Interval]
{hline 22}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}W_cont_civilwar_tm1 {c |}{col 23}{res}{space 2}-.1142734{col 35}{space 2} .0670103{col 46}{space 1}   -1.71{col 55}{space 3}0.088{col 63}{space 4}-.2456332{col 76}{space 3} .0170864
{txt}{space 7}W_cont_war_tm1 {c |}{col 23}{res}{space 2} .1804447{col 35}{space 2} .0713255{col 46}{space 1}    2.53{col 55}{space 3}0.011{col 63}{space 4} .0406259{col 76}{space 3} .3202636
{txt}{space 7}W_ally_war_tm1 {c |}{col 23}{res}{space 2}-.0055281{col 35}{space 2} .0327715{col 46}{space 1}   -0.17{col 55}{space 3}0.866{col 63}{space 4}-.0697699{col 76}{space 3} .0587136
{txt}{space 5}W_cont_milex_tm1 {c |}{col 23}{res}{space 2} .0058989{col 35}{space 2} .0020935{col 46}{space 1}    2.82{col 55}{space 3}0.005{col 63}{space 4} .0017951{col 76}{space 3} .0100027
{txt}{space 6}W_def_milex_tm1 {c |}{col 23}{res}{space 2} .0032886{col 35}{space 2}  .001141{col 46}{space 1}    2.88{col 55}{space 3}0.004{col 63}{space 4} .0010518{col 76}{space 3} .0055254
{txt}{space 9}civilwar_tm1 {c |}{col 23}{res}{space 2}-.3869147{col 35}{space 2} .1457342{col 46}{space 1}   -2.65{col 55}{space 3}0.008{col 63}{space 4}-.6725961{col 76}{space 3}-.1012332
{txt}{space 7}total_wars_tm1 {c |}{col 23}{res}{space 2} .3702533{col 35}{space 2} .1555475{col 46}{space 1}    2.38{col 55}{space 3}0.017{col 63}{space 4} .0653349{col 76}{space 3} .6751717
{txt}{space 10}log_pop_tm1 {c |}{col 23}{res}{space 2} .0241133{col 35}{space 2} .0171073{col 46}{space 1}    1.41{col 55}{space 3}0.159{col 63}{space 4}-.0094221{col 76}{space 3} .0576487
{txt}{space 10}alliance_us {c |}{col 23}{res}{space 2}-.1523262{col 35}{space 2} .0840973{col 46}{space 1}   -1.81{col 55}{space 3}0.070{col 63}{space 4}-.3171814{col 76}{space 3} .0125291
{txt}{space 10}ch_milex_us {c |}{col 23}{res}{space 2}-.0484949{col 35}{space 2} .0819337{col 46}{space 1}   -0.59{col 55}{space 3}0.554{col 63}{space 4}-.2091088{col 76}{space 3} .1121189
{txt}{space 8}ch_milex_ussr {c |}{col 23}{res}{space 2}-.0453126{col 35}{space 2} .0162507{col 46}{space 1}   -2.79{col 55}{space 3}0.005{col 63}{space 4}-.0771687{col 76}{space 3}-.0134564
{txt}{space 5}ally_ch_milex_us {c |}{col 23}{res}{space 2} .2066325{col 35}{space 2} .1272343{col 46}{space 1}    1.62{col 55}{space 3}0.104{col 63}{space 4}-.0427839{col 76}{space 3} .4560489
{txt}ally_ch_milex_us_ussr {c |}{col 23}{res}{space 2} .0161901{col 35}{space 2} .0247722{col 46}{space 1}    0.65{col 55}{space 3}0.513{col 63}{space 4}-.0323706{col 76}{space 3} .0647507
{txt}{space 16}trend {c |}{col 23}{res}{space 2}-.0042916{col 35}{space 2} .0019469{col 46}{space 1}   -2.20{col 55}{space 3}0.028{col 63}{space 4} -.008108{col 76}{space 3}-.0004752
{txt}{space 18}Y42 {c |}{col 23}{res}{space 2}-1.256739{col 35}{space 2} .2067907{col 46}{space 1}   -6.08{col 55}{space 3}0.000{col 63}{space 4}-1.662109{col 76}{space 3}-.8513688
{txt}{space 12}milex_tm1 {c |}{col 23}{res}{space 2} -.136005{col 35}{space 2}  .006335{col 46}{space 1}  -21.47{col 55}{space 3}0.000{col 63}{space 4}-.1484235{col 76}{space 3}-.1235865
{txt}{space 12}ch2_milex {c |}{col 23}{res}{space 2}-.1447431{col 35}{space 2} .0108751{col 46}{space 1}  -13.31{col 55}{space 3}0.000{col 63}{space 4}-.1660615{col 76}{space 3}-.1234246
{txt}{space 19}R2 {c |}{col 23}{res}{space 2} .1577568{col 35}{space 2} .1077478{col 46}{space 1}    1.46{col 55}{space 3}0.143{col 63}{space 4}-.0534603{col 76}{space 3}  .368974
{txt}{space 19}R3 {c |}{col 23}{res}{space 2} -.063195{col 35}{space 2} .0886633{col 46}{space 1}   -0.71{col 55}{space 3}0.476{col 63}{space 4} -.237001{col 76}{space 3}  .110611
{txt}{space 19}R4 {c |}{col 23}{res}{space 2} .0339202{col 35}{space 2}  .090547{col 46}{space 1}    0.37{col 55}{space 3}0.708{col 63}{space 4}-.1435782{col 76}{space 3} .2114187
{txt}{space 19}R5 {c |}{col 23}{res}{space 2}-.0700612{col 35}{space 2} .0940892{col 46}{space 1}   -0.74{col 55}{space 3}0.457{col 63}{space 4}-.2545036{col 76}{space 3} .1143811
{txt}{space 16}_cons {c |}{col 23}{res}{space 2} .2216383{col 35}{space 2} .1739786{col 46}{space 1}    1.27{col 55}{space 3}0.203{col 63}{space 4}-.1194105{col 76}{space 3} .5626871
{txt}{hline 22}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
. mat beta = e(b)
{txt}
{com}. mata: beta = st_matrix("beta")
{res}{txt}
{com}. 
. * Equality of thetas (thetas are different signs across covariates; thetas are statistically different for same covariate--i.e., different spatial patterns of clustering).
. test W_cont_milex_tm1 = W_def_milex_tm1

{p 0 7}{space 1}{text:( 1)}{space 1} {res}W_cont_milex_tm1 - W_def_milex_tm1 = 0{p_end}

{txt}       F(  1,  7244) ={res}    0.97
{txt}{col 13}Prob > F ={res}    0.3252
{txt}
{com}. test W_cont_civilwar_tm1 = W_cont_war_tm1

{p 0 7}{space 1}{text:( 1)}{space 1} {res}W_cont_civilwar_tm1 - W_cont_war_tm1 = 0{p_end}

{txt}       F(  1,  7244) ={res}    8.61
{txt}{col 13}Prob > F ={res}    0.0034
{txt}
{com}. test W_cont_war_tm1 = W_ally_war_tm1

{p 0 7}{space 1}{text:( 1)}{space 1} {res}W_cont_war_tm1 - W_ally_war_tm1 = 0{p_end}

{txt}       F(  1,  7244) ={res}    4.79
{txt}{col 13}Prob > F ={res}    0.0287
{txt}
{com}. 
. *** Substantive effects (Supplemental Materials)
. preserve
{txt}
{com}.         use "Data\Weights Matrices\SLX\Contiguity\W.dta", clear
{txt}
{com}.         mkmat cont*, matrix(Wcont)
{res}{txt}
{com}.         mata: Wcont = st_matrix("Wcont")
{res}{txt}
{com}.         
.         use "Data\Weights Matrices\SLX\Defense\W.dta", clear
{txt}
{com}.         mkmat def*, matrix(Wdef)
{res}{txt}
{com}.         mata: Wdef = st_matrix("Wdef")
{res}{txt}
{com}.         
.         use "Data\Weights Matrices\SLX\Alliance\W.dta", clear
{txt}
{com}.         mkmat all*, matrix(Wally)
{res}{txt}
{com}.         mata: Wally = st_matrix("Wally")
{res}{txt}
{com}.         
.         use "Data\Weights Matrices\SLX\Region\W.dta", clear
{txt}
{com}.         mkmat reg*, matrix(Wreg)
{res}{txt}
{com}.         mata: Wreg = st_matrix("Wreg")
{res}{txt}
{com}. restore
{txt}
{com}. 
. *** Civil war_{c -(}t-1{c )-}
. mata: pd_cw = beta[1,1]*Wcont
{res}{txt}
{com}. mata: ieffect_cw = 1/rows(Wcont)*(sum(pd_cw)-trace(pd_cw))
{res}{txt}
{com}. mata: teffect_cw = beta[1,6] + ieffect_cw
{res}{txt}
{com}. mata: beta[1,6]
{res}  -.3869146933
{txt}
{com}. mata: ieffect_cw
{res}  -.3576021755
{txt}
{com}. mata: teffect_cw
{res}  -.7445168687
{txt}
{com}. 
. *** Interstate war_{c -(}t-1{c )-}
. * Contiguous
. mata: pd_w = beta[1,2]*Wcont
{res}{txt}
{com}. mata: ieffect_w = 1/rows(Wcont)*(sum(pd_w)-trace(pd_w))
{res}{txt}
{com}. mata: ieffect_w
{res}  .5646759384
{txt}
{com}. 
. * Alliance
. mata: pd_w = beta[1,3]*Wally
{res}{txt}
{com}. mata: ieffect_w = 1/rows(Wcont)*(sum(pd_w)-trace(pd_w))
{res}{txt}
{com}. mata: ieffect_w
{res}  -.0558211237
{txt}
{com}. 
. * Contiguous + Ally
. mata: pd_w = beta[1,2]*Wcont + beta[1,3]*Wally
{res}{txt}
{com}. mata: ieffect_w = 1/rows(Wcont)*(sum(pd_w)-trace(pd_w))
{res}{txt}
{com}. mata: teffect_w = beta[1,7] + ieffect_w
{res}{txt}
{com}. mata: beta[1,7]
{res}  .3702532838
{txt}
{com}. mata: ieffect_w
{res}  .5088548147
{txt}
{com}. mata: teffect_w
{res}  .8791080986
{txt}
{com}. 
. *** Military expenditures_{c -(}t-1{c )-}
. * Contiguous
. mata: pd_milex = beta[1,4]*Wcont
{res}{txt}
{com}. mata: ieffect_milex = 1/rows(Wcont)*(sum(pd_milex)-trace(pd_milex))
{res}{txt}
{com}. mata: ieffect_milex
{res}  .0184597604
{txt}
{com}. 
. * Defense Pact
. mata: pd_milex = beta[1,5]*Wdef
{res}{txt}
{com}. mata: ieffect_milex = 1/rows(Wcont)*(sum(pd_milex)-trace(pd_milex))
{res}{txt}
{com}. mata: ieffect_milex
{res}  .0295848294
{txt}
{com}. 
. * Contiguous + Defense Pact
. mata: pd_milex = beta[1,4]*Wcont + beta[1,5]*Wdef
{res}{txt}
{com}. mata: ieffect_milex = 1/rows(Wcont)*(sum(pd_milex)-trace(pd_milex))
{res}{txt}
{com}. mata: teffect_milex = beta[1,16] + ieffect_milex
{res}{txt}
{com}. mata: beta[1,16]
{res}  -.1360049656
{txt}
{com}. mata: ieffect_milex
{res}  .0480445898
{txt}
{com}. mata: teffect_milex
{res}  -.0879603758
{txt}
{com}. 
. 
. 
. *******************************************************************************
. ************************ Supplemental Materials *******************************
. *******************************************************************************
. 
. *** Model 4 (SLX)
. reg ch_milex W_region_civilwar_tm1 W_region2_civilwar_tm1 W_region3_civilwar_tm1 W_region4_civilwar_tm1 W_region5_civilwar_tm1 W_region_war_tm1 /*
> */      civilwar_tm1 total_wars_tm1 log_pop_tm1 trend Y42 milex_tm1 ch2_milex R2 - R5 

{txt}      Source {c |}       SS           df       MS      Number of obs   ={res}     7,266
{txt}{hline 13}{c +}{hline 34}   F(17, 7248)     = {res}    50.75
{txt}       Model {c |} {res} 4616.08679        17  271.534517   {txt}Prob > F        ={res}    0.0000
{txt}    Residual {c |} {res} 38776.6576     7,248  5.34998036   {txt}R-squared       ={res}    0.1064
{txt}{hline 13}{c +}{hline 34}   Adj R-squared   ={res}    0.1043
{txt}       Total {c |} {res} 43392.7444     7,265  5.97284851   {txt}Root MSE        =   {res}  2.313

{txt}{hline 23}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}              ch_milex{col 24}{c |}      Coef.{col 36}   Std. Err.{col 48}      t{col 56}   P>|t|{col 64}     [95% Con{col 77}f. Interval]
{hline 23}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 1}W_region_civilwar_tm1 {c |}{col 24}{res}{space 2}-.1591653{col 36}{space 2} .1041215{col 47}{space 1}   -1.53{col 56}{space 3}0.126{col 64}{space 4}-.3632737{col 77}{space 3} .0449431
{txt}W_region2_civilwar_tm1 {c |}{col 24}{res}{space 2}-.0579121{col 36}{space 2} .1327212{col 47}{space 1}   -0.44{col 56}{space 3}0.663{col 64}{space 4}-.3180843{col 77}{space 3} .2022601
{txt}W_region3_civilwar_tm1 {c |}{col 24}{res}{space 2} .2291207{col 36}{space 2} .1140404{col 47}{space 1}    2.01{col 56}{space 3}0.045{col 64}{space 4} .0055683{col 77}{space 3} .4526732
{txt}W_region4_civilwar_tm1 {c |}{col 24}{res}{space 2} .1122961{col 36}{space 2} .1246932{col 47}{space 1}    0.90{col 56}{space 3}0.368{col 64}{space 4}-.1321389{col 77}{space 3} .3567311
{txt}W_region5_civilwar_tm1 {c |}{col 24}{res}{space 2} .2121281{col 36}{space 2}  .121198{col 47}{space 1}    1.75{col 56}{space 3}0.080{col 64}{space 4}-.0254554{col 77}{space 3} .4497115
{txt}{space 6}W_region_war_tm1 {c |}{col 24}{res}{space 2}-.0001789{col 36}{space 2} .0161336{col 47}{space 1}   -0.01{col 56}{space 3}0.991{col 64}{space 4}-.0318055{col 77}{space 3} .0314476
{txt}{space 10}civilwar_tm1 {c |}{col 24}{res}{space 2}-.4142861{col 36}{space 2} .1465785{col 47}{space 1}   -2.83{col 56}{space 3}0.005{col 64}{space 4}-.7016227{col 77}{space 3}-.1269495
{txt}{space 8}total_wars_tm1 {c |}{col 24}{res}{space 2} .4388601{col 36}{space 2} .1496352{col 47}{space 1}    2.93{col 56}{space 3}0.003{col 64}{space 4} .1455315{col 77}{space 3} .7321888
{txt}{space 11}log_pop_tm1 {c |}{col 24}{res}{space 2}  .035174{col 36}{space 2} .0163672{col 47}{space 1}    2.15{col 56}{space 3}0.032{col 64}{space 4} .0030895{col 77}{space 3} .0672585
{txt}{space 17}trend {c |}{col 24}{res}{space 2}-.0034266{col 36}{space 2} .0018948{col 47}{space 1}   -1.81{col 56}{space 3}0.071{col 64}{space 4}-.0071411{col 77}{space 3} .0002878
{txt}{space 19}Y42 {c |}{col 24}{res}{space 2}-.9995932{col 36}{space 2} .1998108{col 47}{space 1}   -5.00{col 56}{space 3}0.000{col 64}{space 4}-1.391281{col 77}{space 3}-.6079058
{txt}{space 13}milex_tm1 {c |}{col 24}{res}{space 2} -.119505{col 36}{space 2}  .005701{col 47}{space 1}  -20.96{col 56}{space 3}0.000{col 64}{space 4}-.1306806{col 77}{space 3}-.1083294
{txt}{space 13}ch2_milex {c |}{col 24}{res}{space 2}-.1490943{col 36}{space 2} .0108619{col 47}{space 1}  -13.73{col 56}{space 3}0.000{col 64}{space 4}-.1703868{col 77}{space 3}-.1278018
{txt}{space 20}R2 {c |}{col 24}{res}{space 2} .6144734{col 36}{space 2} .1371909{col 47}{space 1}    4.48{col 56}{space 3}0.000{col 64}{space 4} .3455393{col 77}{space 3} .8834075
{txt}{space 20}R3 {c |}{col 24}{res}{space 2}-.2234891{col 36}{space 2} .1071817{col 47}{space 1}   -2.09{col 56}{space 3}0.037{col 64}{space 4}-.4335964{col 77}{space 3}-.0133818
{txt}{space 20}R4 {c |}{col 24}{res}{space 2} .0071205{col 36}{space 2} .1565636{col 47}{space 1}    0.05{col 56}{space 3}0.964{col 64}{space 4}-.2997897{col 77}{space 3} .3140307
{txt}{space 20}R5 {c |}{col 24}{res}{space 2}-.2836314{col 36}{space 2} .0987562{col 47}{space 1}   -2.87{col 56}{space 3}0.004{col 64}{space 4}-.4772224{col 77}{space 3}-.0900404
{txt}{space 17}_cons {c |}{col 24}{res}{space 2} .2232361{col 36}{space 2} .1694253{col 47}{space 1}    1.32{col 56}{space 3}0.188{col 64}{space 4}-.1088868{col 77}{space 3} .5553591
{txt}{hline 23}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. mat beta = e(b)
{txt}
{com}. mata: beta = st_matrix("beta")
{res}{txt}
{com}. 
. *** Substantive effects
. * Europe
. mata: pd_r1 = beta[1,1]*Wreg
{res}{txt}
{com}. mata: ieffect_r1 = 1/rows(Wreg)*(sum(pd_r1)-trace(pd_r1))
{res}{txt}
{com}. mata: ieffect_r1
{res}  -4.636923162
{txt}
{com}. 
. * North Africa/Middle East
. mata: pd_r2 = (beta[1,1]*Wreg) + (beta[1,2]*Wreg)
{res}{txt}
{com}. mata: ieffect_r2 = 1/rows(Wreg)*(sum(pd_r2)-trace(pd_r2))
{res}{txt}
{com}. mata: ieffect_r2
{res}  -6.324061198
{txt}
{com}. 
. * Africa
. mata: pd_r3 = (beta[1,1]*Wreg) + (beta[1,3]*Wreg)
{res}{txt}
{com}. mata: ieffect_r3 = 1/rows(Wreg)*(sum(pd_r3)-trace(pd_r3))
{res}{txt}
{com}. mata: ieffect_r3
{res}  2.037994211
{txt}
{com}. 
. * Asia/Oceania
. mata: pd_r4 = (beta[1,1]*Wreg) + (beta[1,4]*Wreg)
{res}{txt}
{com}. mata: ieffect_r4 = 1/rows(Wreg)*(sum(pd_r4)-trace(pd_r4))
{res}{txt}
{com}. mata: ieffect_r4
{res}  -1.365428446
{txt}
{com}. 
. * North/Central/South America
. mata: pd_r5 = (beta[1,1]*Wreg) + (beta[1,5]*Wreg)
{res}{txt}
{com}. mata: ieffect_r5 = 1/rows(Wreg)*(sum(pd_r5)-trace(pd_r5))
{res}{txt}
{com}. mata: ieffect_r5
{res}  1.542950689
{txt}
{com}. 
. *** Model 5 (SLX)
. reg ch_milex W_region_civilwar_tm1 W_region_war_tm1 W_region2_war_tm1 W_region3_war_tm1 W_region4_war_tm1 W_region5_war_tm1 /*
> */      civilwar_tm1 total_wars_tm1 log_pop_tm1 trend Y42 milex_tm1 ch2_milex R2 - R5

{txt}      Source {c |}       SS           df       MS      Number of obs   ={res}     7,266
{txt}{hline 13}{c +}{hline 34}   F(17, 7248)     = {res}    50.26
{txt}       Model {c |} {res} 4575.62025        17  269.154133   {txt}Prob > F        ={res}    0.0000
{txt}    Residual {c |} {res} 38817.1242     7,248  5.35556349   {txt}R-squared       ={res}    0.1054
{txt}{hline 13}{c +}{hline 34}   Adj R-squared   ={res}    0.1033
{txt}       Total {c |} {res} 43392.7444     7,265  5.97284851   {txt}Root MSE        =   {res} 2.3142

{txt}{hline 22}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}             ch_milex{col 23}{c |}      Coef.{col 35}   Std. Err.{col 47}      t{col 55}   P>|t|{col 63}     [95% Con{col 76}f. Interval]
{hline 22}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
W_region_civilwar_tm1 {c |}{col 23}{res}{space 2}-.0075994{col 35}{space 2} .0306796{col 46}{space 1}   -0.25{col 55}{space 3}0.804{col 63}{space 4}-.0677403{col 76}{space 3} .0525415
{txt}{space 5}W_region_war_tm1 {c |}{col 23}{res}{space 2}-.0489868{col 35}{space 2} .0487906{col 46}{space 1}   -1.00{col 55}{space 3}0.315{col 63}{space 4}-.1446307{col 76}{space 3} .0466571
{txt}{space 4}W_region2_war_tm1 {c |}{col 23}{res}{space 2} .1231721{col 35}{space 2}  .067768{col 46}{space 1}    1.82{col 55}{space 3}0.069{col 63}{space 4}-.0096731{col 76}{space 3} .2560172
{txt}{space 4}W_region3_war_tm1 {c |}{col 23}{res}{space 2} .0563245{col 35}{space 2} .0540034{col 46}{space 1}    1.04{col 55}{space 3}0.297{col 63}{space 4} -.049538{col 76}{space 3} .1621869
{txt}{space 4}W_region4_war_tm1 {c |}{col 23}{res}{space 2} .0202572{col 35}{space 2} .0568394{col 46}{space 1}    0.36{col 55}{space 3}0.722{col 63}{space 4}-.0911646{col 76}{space 3}  .131679
{txt}{space 4}W_region5_war_tm1 {c |}{col 23}{res}{space 2}  .064142{col 35}{space 2} .0956662{col 46}{space 1}    0.67{col 55}{space 3}0.503{col 63}{space 4}-.1233915{col 76}{space 3} .2516756
{txt}{space 9}civilwar_tm1 {c |}{col 23}{res}{space 2}-.3872727{col 35}{space 2}  .145968{col 46}{space 1}   -2.65{col 55}{space 3}0.008{col 63}{space 4}-.6734125{col 76}{space 3}-.1011329
{txt}{space 7}total_wars_tm1 {c |}{col 23}{res}{space 2} .4443487{col 35}{space 2} .1500406{col 46}{space 1}    2.96{col 55}{space 3}0.003{col 63}{space 4} .1502254{col 76}{space 3}  .738472
{txt}{space 10}log_pop_tm1 {c |}{col 23}{res}{space 2} .0355755{col 35}{space 2} .0163665{col 46}{space 1}    2.17{col 55}{space 3}0.030{col 63}{space 4} .0034923{col 76}{space 3} .0676586
{txt}{space 16}trend {c |}{col 23}{res}{space 2}-.0042516{col 35}{space 2} .0018999{col 46}{space 1}   -2.24{col 55}{space 3}0.025{col 63}{space 4}-.0079759{col 76}{space 3}-.0005273
{txt}{space 18}Y42 {c |}{col 23}{res}{space 2}-1.042269{col 35}{space 2} .2032031{col 46}{space 1}   -5.13{col 55}{space 3}0.000{col 63}{space 4}-1.440606{col 76}{space 3}-.6439318
{txt}{space 12}milex_tm1 {c |}{col 23}{res}{space 2}-.1197053{col 35}{space 2} .0056987{col 46}{space 1}  -21.01{col 55}{space 3}0.000{col 63}{space 4}-.1308764{col 76}{space 3}-.1085342
{txt}{space 12}ch2_milex {c |}{col 23}{res}{space 2}-.1494077{col 35}{space 2} .0108878{col 46}{space 1}  -13.72{col 55}{space 3}0.000{col 63}{space 4} -.170751{col 76}{space 3}-.1280644
{txt}{space 19}R2 {c |}{col 23}{res}{space 2} .2947362{col 35}{space 2}  .119014{col 46}{space 1}    2.48{col 55}{space 3}0.013{col 63}{space 4} .0614341{col 76}{space 3} .5280383
{txt}{space 19}R3 {c |}{col 23}{res}{space 2}-.1115003{col 35}{space 2} .0948523{col 46}{space 1}   -1.18{col 55}{space 3}0.240{col 63}{space 4}-.2974384{col 76}{space 3} .0744379
{txt}{space 19}R4 {c |}{col 23}{res}{space 2}-.0083987{col 35}{space 2} .1135077{col 46}{space 1}   -0.07{col 55}{space 3}0.941{col 63}{space 4}-.2309068{col 76}{space 3} .2141093
{txt}{space 19}R5 {c |}{col 23}{res}{space 2}-.2415625{col 35}{space 2}  .101774{col 46}{space 1}   -2.37{col 55}{space 3}0.018{col 63}{space 4}-.4410692{col 76}{space 3}-.0420558
{txt}{space 16}_cons {c |}{col 23}{res}{space 2}  .237907{col 35}{space 2} .1712583{col 46}{space 1}    1.39{col 55}{space 3}0.165{col 63}{space 4}-.0978092{col 76}{space 3} .5736232
{txt}{hline 22}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. mat beta = e(b)
{txt}
{com}. mata: beta = st_matrix("beta")
{res}{txt}
{com}. 
. *** Substantive effects
. * Europe
. mata: pd_r1 = beta[1,2]*Wreg
{res}{txt}
{com}. mata: ieffect_r1 = 1/rows(Wreg)*(sum(pd_r1)-trace(pd_r1))
{res}{txt}
{com}. mata: ieffect_r1
{res}  -1.427120353
{txt}
{com}. 
. * North Africa/Middle East
. mata: pd_r2 = (beta[1,2]*Wreg) + (beta[1,3]*Wreg)
{res}{txt}
{com}. mata: ieffect_r2 = 1/rows(Wreg)*(sum(pd_r2)-trace(pd_r2))
{res}{txt}
{com}. mata: ieffect_r2
{res}  2.161220429
{txt}
{com}. 
. * Africa
. mata: pd_r3 = (beta[1,2]*Wreg) + (beta[1,4]*Wreg)
{res}{txt}
{com}. mata: ieffect_r3 = 1/rows(Wreg)*(sum(pd_r3)-trace(pd_r3))
{res}{txt}
{com}. mata: ieffect_r3
{res}  .2137660647
{txt}
{com}. 
. * Asia/Oceania
. mata: pd_r4 = (beta[1,2]*Wreg) + (beta[1,5]*Wreg)
{res}{txt}
{com}. mata: ieffect_r4 = 1/rows(Wreg)*(sum(pd_r4)-trace(pd_r4))
{res}{txt}
{com}. mata: ieffect_r4
{res}  -.8369719235
{txt}
{com}. 
. * North/Central/South America
. mata: pd_r5 = (beta[1,2]*Wreg) + (beta[1,6]*Wreg)
{res}{txt}
{com}. mata: ieffect_r5 = 1/rows(Wreg)*(sum(pd_r5)-trace(pd_r5))
{res}{txt}
{com}. mata: ieffect_r5
{res}  .4415136873
{txt}
{com}. 
. 
. *** Model 6 (SLX)
. reg ch_milex W_cont_war_tm1 WW_cont_war_tm1 WWW_cont_war_tm1 /*
> */      civilwar_tm1 total_wars_tm1 log_pop_tm1 trend Y42 milex_tm1 ch2_milex R2 - R5 

{txt}      Source {c |}       SS           df       MS      Number of obs   ={res}     7,266
{txt}{hline 13}{c +}{hline 34}   F(14, 7251)     = {res}    61.59
{txt}       Model {c |} {res} 4611.41289        14  329.386635   {txt}Prob > F        ={res}    0.0000
{txt}    Residual {c |} {res} 38781.3315     7,251  5.34841146   {txt}R-squared       ={res}    0.1063
{txt}{hline 13}{c +}{hline 34}   Adj R-squared   ={res}    0.1045
{txt}       Total {c |} {res} 43392.7444     7,265  5.97284851   {txt}Root MSE        =   {res} 2.3127

{txt}{hline 17}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}        ch_milex{col 18}{c |}      Coef.{col 30}   Std. Err.{col 42}      t{col 50}   P>|t|{col 58}     [95% Con{col 71}f. Interval]
{hline 17}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}W_cont_war_tm1 {c |}{col 18}{res}{space 2} .1618436{col 30}{space 2} .1191435{col 41}{space 1}    1.36{col 50}{space 3}0.174{col 58}{space 4}-.0717124{col 71}{space 3} .3953995
{txt}{space 1}WW_cont_war_tm1 {c |}{col 18}{res}{space 2} .0153907{col 30}{space 2} .0538525{col 41}{space 1}    0.29{col 50}{space 3}0.775{col 58}{space 4}-.0901758{col 71}{space 3} .1209572
{txt}WWW_cont_war_tm1 {c |}{col 18}{res}{space 2} .0015756{col 30}{space 2} .0124025{col 41}{space 1}    0.13{col 50}{space 3}0.899{col 58}{space 4}-.0227368{col 71}{space 3}  .025888
{txt}{space 4}civilwar_tm1 {c |}{col 18}{res}{space 2}-.4167324{col 30}{space 2} .1460273{col 41}{space 1}   -2.85{col 50}{space 3}0.004{col 58}{space 4}-.7029885{col 71}{space 3}-.1304764
{txt}{space 2}total_wars_tm1 {c |}{col 18}{res}{space 2}  .240949{col 30}{space 2} .2059151{col 41}{space 1}    1.17{col 50}{space 3}0.242{col 58}{space 4}-.1627044{col 71}{space 3} .6446025
{txt}{space 5}log_pop_tm1 {c |}{col 18}{res}{space 2} .0316306{col 30}{space 2} .0164383{col 41}{space 1}    1.92{col 50}{space 3}0.054{col 58}{space 4}-.0005933{col 71}{space 3} .0638544
{txt}{space 11}trend {c |}{col 18}{res}{space 2}-.0041683{col 30}{space 2}   .00183{col 41}{space 1}   -2.28{col 50}{space 3}0.023{col 58}{space 4}-.0077557{col 71}{space 3}-.0005809
{txt}{space 13}Y42 {c |}{col 18}{res}{space 2}-1.046643{col 30}{space 2} .1985179{col 41}{space 1}   -5.27{col 50}{space 3}0.000{col 58}{space 4}-1.435796{col 71}{space 3}-.6574906
{txt}{space 7}milex_tm1 {c |}{col 18}{res}{space 2}-.1217409{col 30}{space 2} .0057581{col 41}{space 1}  -21.14{col 50}{space 3}0.000{col 58}{space 4}-.1330284{col 71}{space 3}-.1104534
{txt}{space 7}ch2_milex {c |}{col 18}{res}{space 2}-.1484036{col 30}{space 2} .0108653{col 41}{space 1}  -13.66{col 50}{space 3}0.000{col 58}{space 4}-.1697028{col 71}{space 3}-.1271043
{txt}{space 14}R2 {c |}{col 18}{res}{space 2} .3632955{col 30}{space 2} .0964566{col 41}{space 1}    3.77{col 50}{space 3}0.000{col 58}{space 4} .1742124{col 71}{space 3} .5523785
{txt}{space 14}R3 {c |}{col 18}{res}{space 2}-.0898483{col 30}{space 2} .0795544{col 41}{space 1}   -1.13{col 50}{space 3}0.259{col 58}{space 4}-.2457981{col 71}{space 3} .0661014
{txt}{space 14}R4 {c |}{col 18}{res}{space 2}-.0510756{col 30}{space 2} .0848092{col 41}{space 1}   -0.60{col 50}{space 3}0.547{col 58}{space 4}-.2173264{col 71}{space 3} .1151752
{txt}{space 14}R5 {c |}{col 18}{res}{space 2}-.1965912{col 30}{space 2} .0841421{col 41}{space 1}   -2.34{col 50}{space 3}0.019{col 58}{space 4}-.3615343{col 71}{space 3}-.0316482
{txt}{space 11}_cons {c |}{col 18}{res}{space 2} .2261681{col 30}{space 2}  .167344{col 41}{space 1}    1.35{col 50}{space 3}0.177{col 58}{space 4}-.1018749{col 71}{space 3}  .554211
{txt}{hline 17}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
. mat beta = e(b)
{txt}
{com}. mata: beta = st_matrix("beta")
{res}{txt}
{com}. 
. *** Substantive Effects of Interstate War
. * First-Order Indirect Effects
. mata: pd1 = beta[1,1]*Wcont
{res}{txt}
{com}. mata: ieffect1 = 1/rows(Wcont)*(sum(pd1)-trace(pd1))
{res}{txt}
{com}. mata: ieffect1
{res}  .5064661664
{txt}
{com}. 
. * Second-Order Indirect Effects
. mata: pd2 = beta[1,2]*Wcont*Wcont
{res}{txt}
{com}. mata: deffect2 = 1/rows(Wcont)*trace(pd2)
{res}{txt}
{com}. mata: teffect2 = 1/rows(Wcont)*sum(pd2)
{res}{txt}
{com}. mata: ieffect2 = 1/rows(Wcont)*(sum(pd2)-trace(pd2))
{res}{txt}
{com}. mata: deffect2
{res}  .0481508803
{txt}
{com}. mata: ieffect2
{res}  .1852105287
{txt}
{com}. mata: teffect2
{res}  .233361409
{txt}
{com}. 
. * Third-Order Indirect Effects
. mata: pd3 = beta[1,3]*Wcont*Wcont*Wcont
{res}{txt}
{com}. mata: deffect3 = 1/rows(Wcont)*trace(pd3)
{res}{txt}
{com}. mata: teffect3 = 1/rows(Wcont)*sum(pd3)
{res}{txt}
{com}. mata: ieffect3 = 1/rows(Wcont)*(sum(pd3)-trace(pd3))
{res}{txt}
{com}. mata: deffect3
{res}  .0070590226
{txt}
{com}. mata: ieffect3
{res}  .1081869311
{txt}
{com}. mata: teffect3
{res}  .1152459537
{txt}
{com}. 
. * Total Indirect Effects
. mata: pdt = beta[1,1]*Wcont + beta[1,2]*Wcont*Wcont + beta[1,3]*Wcont*Wcont*Wcont
{res}{txt}
{com}. mata: deffectt = 1/rows(Wcont)*trace(pdt)
{res}{txt}
{com}. mata: teffectt = 1/rows(Wcont)*sum(pdt)
{res}{txt}
{com}. mata: ieffectt = 1/rows(Wcont)*(sum(pdt)-trace(pdt))
{res}{txt}
{com}. mata: deffectt + beta[1,5]
{res}  .2961589491
{txt}
{com}. mata: ieffectt
{res}  .7998636261
{txt}
{com}. mata: ieffectt + (deffectt + beta[1,5])
{res}  1.096022575
{txt}
{com}. 
. *** Figure S.1: Total effects of interstate war across European states in 2007 (Model S.2)
. * Illustration: Europe (region == 1), 2007: obs 7424-7464
. preserve
{txt}
{com}.         keep in 7424/7464
{txt}(7,620 observations deleted)

{com}.         keep ccode
{txt}
{com}.         mkmat ccode, matrix(ccode)
{res}{txt}
{com}. restore
{txt}
{com}. 
. mata: europe3 = pdt[(7424..7464), (7424..7464)]
{res}{txt}
{com}. mata: europe3
{res}        {txt}          1             2             3             4             5             6             7
     {c TLC}{hline 99}
   1 {c |}  {res}.0153906831   .1634191471             0             0             0             0             0
{txt}   2 {c |}  {res}.1634191471   .0153906831             0             0             0             0             0
{txt}   3 {c |}  {res}          0             0   .0339325578   .1882634047   .0370837492    .038659345   .0216930661
{txt}   4 {c |}  {res}          0             0   .1882634047   .0741674985   .2068052793   .2131076622   .0418105364
{txt}   5 {c |}  {res}          0             0   .0370837492   .2068052793   .0556256239   .2099564708   .0402349407
{txt}   6 {c |}  {res}          0             0    .038659345   .2131076622   .2099564708   .1081000562   .2131076622
{txt}   7 {c |}  {res}          0             0   .0216930661   .0418105364   .0402349407   .2131076622   .0741674985
{txt}   8 {c |}  {res}          0             0   .0031511915   .0185418746   .0185418746   .1744483173   .0185418746
{txt}   9 {c |}  {res}          0             0             0   .0015755957   .0015755957   .0153906831   .0015755957
{txt}  10 {c |}  {res}          0             0   .1961413834   .2316495369   .2162588537   .2395275155   .2194100452
{txt}  11 {c |}  {res}          0             0   .0185418746   .0216930661   .0201174704   .0216930661   .0232686618
{txt}  12 {c |}  {res}          0             0   .0201174704   .0264198533   .0248442576   .0587768153    .214683258
{txt}  13 {c |}  {res}          0             0   .0015755957   .0015755957   .0015755957   .0063023829   .0232686618
{txt}  14 {c |}  {res}          0             0   .0201174704   .0232686618   .0216930661   .0264198533   .0402349407
{txt}  15 {c |}  {res}          0             0   .0047267872   .0047267872   .0047267872   .0078779787   .0248442576
{txt}  16 {c |}  {res}          0             0   .0063023829   .0232686618   .0232686618   .1961413834    .208380875
{txt}  17 {c |}  {res}          0             0             0             0             0             0             0
{txt}  18 {c |}  {res}          0             0             0             0             0             0             0
{txt}  19 {c |}  {res}          0             0             0             0             0             0             0
{txt}  20 {c |}  {res}          0             0             0             0             0             0             0
{txt}  21 {c |}  {res}          0             0             0             0             0   .0015755957   .0047267872
{txt}  22 {c |}  {res}          0             0             0             0             0             0             0
{txt}  23 {c |}  {res}          0             0   .0015755957   .0031511915   .0031511915   .0216930661    .038659345
{txt}  24 {c |}  {res}          0             0             0             0             0             0             0
{txt}  25 {c |}  {res}          0             0             0             0             0             0             0
{txt}  26 {c |}  {res}          0             0             0             0             0             0             0
{txt}  27 {c |}  {res}          0             0             0             0             0             0             0
{txt}  28 {c |}  {res}          0             0             0             0             0             0   .0015755957
{txt}  29 {c |}  {res}          0             0   .0015755957   .0015755957   .0015755957   .0015755957   .0015755957
{txt}  30 {c |}  {res}          0             0             0             0             0             0             0
{txt}  31 {c |}  {res}          0             0             0             0             0             0             0
{txt}  32 {c |}  {res}          0             0   .0015755957   .0015755957   .0015755957   .0015755957   .0015755957
{txt}  33 {c |}  {res}          0             0   .0015755957   .0015755957   .0015755957   .0015755957   .0047267872
{txt}  34 {c |}  {res}          0             0   .0015755957   .0015755957   .0015755957   .0015755957   .0015755957
{txt}  35 {c |}  {res}          0             0             0             0             0             0             0
{txt}  36 {c |}  {res}          0             0             0             0             0             0             0
{txt}  37 {c |}  {res}          0             0             0             0             0             0             0
{txt}  38 {c |}  {res}          0             0             0             0             0             0             0
{txt}  39 {c |}  {res}          0             0             0             0             0             0             0
{txt}  40 {c |}  {res}          0             0             0             0             0             0             0
{txt}  41 {c |}  {res}          0             0   .0169662789   .0201174704   .0185418746   .0201174704   .0185418746
{txt}     {c BLC}{hline 99}
                  8             9            10            11            12            13            14
      {hline 99}
   1    {res}          0             0             0             0             0             0             0
{txt}   2    {res}          0             0             0             0             0             0             0
{txt}   3    {res}.0031511915             0   .1961413834   .0185418746   .0201174704   .0015755957   .0201174704
{txt}   4    {res}.0185418746   .0015755957   .2316495369   .0216930661   .0264198533   .0015755957   .0232686618
{txt}   5    {res}.0185418746   .0015755957   .2162588537   .0201174704   .0248442576   .0015755957   .0216930661
{txt}   6    {res}.1744483173   .0153906831   .2395275155   .0216930661   .0587768153   .0063023829   .0264198533
{txt}   7    {res}.0185418746   .0015755957   .2194100452   .0232686618    .214683258   .0232686618   .0402349407
{txt}   8    {res}.0461720494   .1665703386   .0201174704   .0015755957   .0047267872             0   .0015755957
{txt}   9    {res}.1665703386   .0153906831   .0015755957             0             0             0             0
{txt}  10    {res}.0201174704   .0015755957   .1637256801   .2055949578   .2257124281   .0264198533   .2162588537
{txt}  11    {res}.0015755957             0   .2055949578   .1329443138   .0587768153   .0449617279   .2131076622
{txt}  12    {res}.0047267872             0   .2257124281   .0587768153   .1297931223   .2178344494    .214683258
{txt}  13    {res}          0             0   .0264198533   .0449617279   .2178344494   .1081000562   .0418105364
{txt}  14    {res}.0015755957             0   .2162588537   .2131076622    .214683258   .0418105364   .0741674985
{txt}  15    {res}          0             0   .0572012196   .2194100452   .2178344494    .214683258   .2115320665
{txt}  16    {res}.0169662789   .0015755957   .0587768153   .0078779787    .214683258    .038659345   .0248442576
{txt}  17    {res}          0             0             0             0             0             0             0
{txt}  18    {res}          0             0             0             0             0             0             0
{txt}  19    {res}          0             0             0             0             0             0             0
{txt}  20    {res}          0             0             0             0             0   .0015755957             0
{txt}  21    {res}          0             0   .0031511915   .0031511915   .0370837492   .1914145961   .0047267872
{txt}  22    {res}          0             0             0             0   .0031511915   .0169662789             0
{txt}  23    {res}.0015755957             0   .0248442576   .0078779787   .2131076622   .2099564708   .0232686618
{txt}  24    {res}          0             0             0             0             0   .0015755957             0
{txt}  25    {res}          0             0             0             0             0             0             0
{txt}  26    {res}          0             0             0   .0015755957   .0015755957   .0169662789             0
{txt}  27    {res}          0             0   .0015755957   .0216930661   .0047267872   .0355081535   .0031511915
{txt}  28    {res}          0             0   .0031511915   .0248442576   .0216930661   .1945657876   .0063023829
{txt}  29    {res}          0             0   .0216930661     .24898109   .0078779787   .0232686618   .0248442576
{txt}  30    {res}          0             0   .0015755957   .0248442576             0   .0015755957   .0015755957
{txt}  31    {res}          0             0   .0047267872   .0603524111             0   .0031511915   .0047267872
{txt}  32    {res}          0             0   .0201174704   .2178344494   .0047267872   .0063023829   .0216930661
{txt}  33    {res}          0             0   .0264198533   .2379519198   .0433861322   .2162588537   .0433861322
{txt}  34    {res}          0             0   .0216930661   .2363763241   .0078779787   .0232686618   .0248442576
{txt}  35    {res}          0             0             0   .0031511915             0             0             0
{txt}  36    {res}          0             0   .0015755957   .0216930661             0   .0015755957   .0015755957
{txt}  37    {res}          0             0   .0015755957   .0216930661             0   .0015755957   .0015755957
{txt}  38    {res}          0             0   .0015755957   .0216930661             0   .0015755957   .0015755957
{txt}  39    {res}          0             0             0   .0031511915             0             0             0
{txt}  40    {res}          0             0   .0015755957   .0216930661             0   .0015755957   .0015755957
{txt}  41    {res}.0015755957             0    .176023913   .0169662789   .0185418746   .0015755957   .0185418746
{txt}      {hline 99}
                 15            16            17            18            19            20            21
      {hline 99}
   1    {res}          0             0             0             0             0             0             0
{txt}   2    {res}          0             0             0             0             0             0             0
{txt}   3    {res}.0047267872   .0063023829             0             0             0             0             0
{txt}   4    {res}.0047267872   .0232686618             0             0             0             0             0
{txt}   5    {res}.0047267872   .0232686618             0             0             0             0             0
{txt}   6    {res}.0078779787   .1961413834             0             0             0             0   .0015755957
{txt}   7    {res}.0248442576    .208380875             0             0             0             0   .0047267872
{txt}   8    {res}          0   .0169662789             0             0             0             0             0
{txt}   9    {res}          0   .0015755957             0             0             0             0             0
{txt}  10    {res}.0572012196   .0587768153             0             0             0             0   .0031511915
{txt}  11    {res}.2194100452   .0078779787             0             0             0             0   .0031511915
{txt}  12    {res}.2178344494    .214683258             0             0             0             0   .0370837492
{txt}  13    {res} .214683258    .038659345             0             0             0   .0015755957   .1914145961
{txt}  14    {res}.2115320665   .0248442576             0             0             0             0   .0047267872
{txt}  15    {res}.0927093731   .0232686618             0             0             0             0   .0216930661
{txt}  16    {res}.0232686618    .071016307             0             0             0             0   .0201174704
{txt}  17    {res}          0             0             0             0             0             0             0
{txt}  18    {res}          0             0             0   .0339325578             0   .1851122132             0
{txt}  19    {res}          0             0             0             0             0             0             0
{txt}  20    {res}          0             0             0   .1851122132             0   .0524744324             0
{txt}  21    {res}.0216930661   .0201174704             0             0             0             0   .0493232409
{txt}  22    {res}.0015755957   .0015755957             0             0             0             0   .1665703386
{txt}  23    {res}.0402349407   .1914145961             0             0             0             0   .1882634047
{txt}  24    {res}          0             0             0   .1866878089             0   .2036540878             0
{txt}  25    {res}          0             0             0   .0015755957             0   .0031511915             0
{txt}  26    {res}.0031511915             0             0   .0355081535             0   .1898390004   .0015755957
{txt}  27    {res}.0216930661             0             0             0             0   .0015755957   .0031511915
{txt}  28    {res} .038659345   .0031511915             0   .0031511915             0   .0169662789   .0185418746
{txt}  29    {res}.0418105364             0             0             0             0             0   .0015755957
{txt}  30    {res}.0031511915             0             0             0             0             0             0
{txt}  31    {res}.0078779787             0             0             0             0             0             0
{txt}  32    {res}.0248442576             0             0             0             0             0             0
{txt}  33    {res}.2178344494   .0047267872             0             0             0   .0015755957   .0201174704
{txt}  34    {res}.0418105364             0             0             0             0             0   .0015755957
{txt}  35    {res}          0             0             0   .0015755957             0   .0031511915             0
{txt}  36    {res}.0031511915             0             0   .0015755957             0   .0031511915             0
{txt}  37    {res}.0031511915             0             0   .0015755957             0   .0031511915             0
{txt}  38    {res}.0031511915             0             0             0             0             0             0
{txt}  39    {res}          0             0             0             0             0             0             0
{txt}  40    {res}.0031511915             0             0             0             0             0             0
{txt}  41    {res}.0047267872   .0047267872             0             0             0             0             0
{txt}      {hline 99}
                 22            23            24            25            26            27            28
      {hline 99}
   1    {res}          0             0             0             0             0             0             0
{txt}   2    {res}          0             0             0             0             0             0             0
{txt}   3    {res}          0   .0015755957             0             0             0             0             0
{txt}   4    {res}          0   .0031511915             0             0             0             0             0
{txt}   5    {res}          0   .0031511915             0             0             0             0             0
{txt}   6    {res}          0   .0216930661             0             0             0             0             0
{txt}   7    {res}          0    .038659345             0             0             0             0   .0015755957
{txt}   8    {res}          0   .0015755957             0             0             0             0             0
{txt}   9    {res}          0             0             0             0             0             0             0
{txt}  10    {res}          0   .0248442576             0             0             0   .0015755957   .0031511915
{txt}  11    {res}          0   .0078779787             0             0   .0015755957   .0216930661   .0248442576
{txt}  12    {res}.0031511915   .2131076622             0             0   .0015755957   .0047267872   .0216930661
{txt}  13    {res}.0169662789   .2099564708   .0015755957             0   .0169662789   .0355081535   .1945657876
{txt}  14    {res}          0   .0232686618             0             0             0   .0031511915   .0063023829
{txt}  15    {res}.0015755957   .0402349407             0             0   .0031511915   .0216930661    .038659345
{txt}  16    {res}.0015755957   .1914145961             0             0             0             0   .0031511915
{txt}  17    {res}          0             0             0             0             0             0             0
{txt}  18    {res}          0             0   .1866878089   .0015755957   .0355081535             0   .0031511915
{txt}  19    {res}          0             0             0             0             0             0             0
{txt}  20    {res}          0             0   .2036540878   .0031511915   .1898390004   .0015755957   .0169662789
{txt}  21    {res}.1665703386   .1882634047             0             0   .0015755957   .0031511915   .0185418746
{txt}  22    {res}.0153906831   .0169662789             0             0             0             0   .0015755957
{txt}  23    {res}.0169662789    .071016307             0             0   .0015755957   .0031511915   .0201174704
{txt}  24    {res}          0             0    .071016307   .0169662789   .2052296836   .0015755957   .0185418746
{txt}  25    {res}          0             0   .0169662789   .0153906831   .0169662789             0   .0015755957
{txt}  26    {res}          0   .0015755957   .2052296836   .0169662789   .0678651155   .0169662789   .1728727215
{txt}  27    {res}          0   .0031511915   .0015755957             0   .0169662789   .0339325578   .1866878089
{txt}  28    {res}.0015755957   .0201174704   .0185418746   .0015755957   .1728727215   .1866878089   .0678651155
{txt}  29    {res}          0   .0015755957   .0031511915   .0031511915   .0047267872   .0201174704   .0216930661
{txt}  30    {res}          0             0             0             0             0   .0015755957   .0015755957
{txt}  31    {res}          0             0             0             0             0   .0031511915   .0031511915
{txt}  32    {res}          0             0             0             0             0   .0047267872   .0047267872
{txt}  33    {res}.0015755957   .0232686618   .0015755957             0   .0185418746   .1914145961   .2099564708
{txt}  34    {res}          0   .0015755957             0             0   .0015755957   .0201174704   .0216930661
{txt}  35    {res}          0             0   .0216930661   .0201174704   .0216930661             0   .0015755957
{txt}  36    {res}          0             0   .0201174704   .0185418746   .0201174704   .0015755957   .0031511915
{txt}  37    {res}          0             0   .0216930661   .0201174704   .0216930661   .0015755957   .0031511915
{txt}  38    {res}          0             0             0             0             0   .0015755957   .0015755957
{txt}  39    {res}          0             0             0             0             0             0             0
{txt}  40    {res}          0             0             0             0             0   .0015755957   .0015755957
{txt}  41    {res}          0   .0015755957             0             0             0             0             0
{txt}      {hline 99}
                 29            30            31            32            33            34            35
      {hline 99}
   1    {res}          0             0             0             0             0             0             0
{txt}   2    {res}          0             0             0             0             0             0             0
{txt}   3    {res}.0015755957             0             0   .0015755957   .0015755957   .0015755957             0
{txt}   4    {res}.0015755957             0             0   .0015755957   .0015755957   .0015755957             0
{txt}   5    {res}.0015755957             0             0   .0015755957   .0015755957   .0015755957             0
{txt}   6    {res}.0015755957             0             0   .0015755957   .0015755957   .0015755957             0
{txt}   7    {res}.0015755957             0             0   .0015755957   .0047267872   .0015755957             0
{txt}   8    {res}          0             0             0             0             0             0             0
{txt}   9    {res}          0             0             0             0             0             0             0
{txt}  10    {res}.0216930661   .0015755957   .0047267872   .0201174704   .0264198533   .0216930661             0
{txt}  11    {res}  .24898109   .0248442576   .0603524111   .2178344494   .2379519198   .2363763241   .0031511915
{txt}  12    {res}.0078779787             0             0   .0047267872   .0433861322   .0078779787             0
{txt}  13    {res}.0232686618   .0015755957   .0031511915   .0063023829   .2162588537   .0232686618             0
{txt}  14    {res}.0248442576   .0015755957   .0047267872   .0216930661   .0433861322   .0248442576             0
{txt}  15    {res}.0418105364   .0031511915   .0078779787   .0248442576   .2178344494   .0418105364             0
{txt}  16    {res}          0             0             0             0   .0047267872             0             0
{txt}  17    {res}          0             0             0             0             0             0             0
{txt}  18    {res}          0             0             0             0             0             0   .0015755957
{txt}  19    {res}          0             0             0             0             0             0             0
{txt}  20    {res}          0             0             0             0   .0015755957             0   .0031511915
{txt}  21    {res}.0015755957             0             0             0   .0201174704   .0015755957             0
{txt}  22    {res}          0             0             0             0   .0015755957             0             0
{txt}  23    {res}.0015755957             0             0             0   .0232686618   .0015755957             0
{txt}  24    {res}.0031511915             0             0             0   .0015755957             0   .0216930661
{txt}  25    {res}.0031511915             0             0             0             0             0   .0201174704
{txt}  26    {res}.0047267872             0             0             0   .0185418746   .0015755957   .0216930661
{txt}  27    {res}.0201174704   .0015755957   .0031511915   .0047267872   .1914145961   .0201174704             0
{txt}  28    {res}.0216930661   .0015755957   .0031511915   .0047267872   .2099564708   .0216930661   .0015755957
{txt}  29    {res}.2378931786   .2024437663   .2411031113   .2442543027   .2320148111   .2612205816    .038659345
{txt}  30    {res}.2024437663   .0339325578   .1882634047    .038659345   .0216930661   .0402349407   .0031511915
{txt}  31    {res}.2411031113   .1882634047   .0741674985   .2115320665   .0433861322    .214683258   .0031511915
{txt}  32    {res}.2442543027    .038659345   .2115320665   .0773186899   .0603524111   .2300739411   .0031511915
{txt}  33    {res}.2320148111   .0216930661   .0433861322   .0603524111   .1297931223   .2194100452   .0031511915
{txt}  34    {res}.2612205816   .0402349407    .214683258   .2300739411   .2194100452    .099011756   .0031511915
{txt}  35    {res} .038659345   .0031511915   .0031511915   .0031511915   .0031511915   .0031511915   .0773186899
{txt}  36    {res}.2055949578   .0185418746   .0216930661   .0216930661   .0201174704   .0232686618   .2115320665
{txt}  37    {res}.2071705535   .0185418746   .0216930661   .0216930661   .0201174704   .0232686618   .2284983454
{txt}  38    {res}.2024437663   .0185418746   .0216930661   .0216930661   .0201174704   .0232686618   .0031511915
{txt}  39    {res}.0339325578   .0031511915   .0031511915   .0031511915   .0031511915   .0031511915             0
{txt}  40    {res}.2024437663   .0185418746   .0216930661   .0216930661   .0201174704   .0232686618   .0031511915
{txt}  41    {res}.0015755957             0             0   .0015755957   .0015755957   .0015755957             0
{txt}      {hline 99}
                 36            37            38            39            40            41
      {hline 85}{c TRC}
   1    {res}          0             0             0             0             0             0{txt}  {c |}
   2    {res}          0             0             0             0             0             0{txt}  {c |}
   3    {res}          0             0             0             0             0   .0169662789{txt}  {c |}
   4    {res}          0             0             0             0             0   .0201174704{txt}  {c |}
   5    {res}          0             0             0             0             0   .0185418746{txt}  {c |}
   6    {res}          0             0             0             0             0   .0201174704{txt}  {c |}
   7    {res}          0             0             0             0             0   .0185418746{txt}  {c |}
   8    {res}          0             0             0             0             0   .0015755957{txt}  {c |}
   9    {res}          0             0             0             0             0             0{txt}  {c |}
  10    {res}.0015755957   .0015755957   .0015755957             0   .0015755957    .176023913{txt}  {c |}
  11    {res}.0216930661   .0216930661   .0216930661   .0031511915   .0216930661   .0169662789{txt}  {c |}
  12    {res}          0             0             0             0             0   .0185418746{txt}  {c |}
  13    {res}.0015755957   .0015755957   .0015755957             0   .0015755957   .0015755957{txt}  {c |}
  14    {res}.0015755957   .0015755957   .0015755957             0   .0015755957   .0185418746{txt}  {c |}
  15    {res}.0031511915   .0031511915   .0031511915             0   .0031511915   .0047267872{txt}  {c |}
  16    {res}          0             0             0             0             0   .0047267872{txt}  {c |}
  17    {res}          0             0             0             0             0             0{txt}  {c |}
  18    {res}.0015755957   .0015755957             0             0             0             0{txt}  {c |}
  19    {res}          0             0             0             0             0             0{txt}  {c |}
  20    {res}.0031511915   .0031511915             0             0             0             0{txt}  {c |}
  21    {res}          0             0             0             0             0             0{txt}  {c |}
  22    {res}          0             0             0             0             0             0{txt}  {c |}
  23    {res}          0             0             0             0             0   .0015755957{txt}  {c |}
  24    {res}.0201174704   .0216930661             0             0             0             0{txt}  {c |}
  25    {res}.0185418746   .0201174704             0             0             0             0{txt}  {c |}
  26    {res}.0201174704   .0216930661             0             0             0             0{txt}  {c |}
  27    {res}.0015755957   .0015755957   .0015755957             0   .0015755957             0{txt}  {c |}
  28    {res}.0031511915   .0031511915   .0015755957             0   .0015755957             0{txt}  {c |}
  29    {res}.2055949578   .2071705535   .2024437663   .0339325578   .2024437663   .0015755957{txt}  {c |}
  30    {res}.0185418746   .0185418746   .0185418746   .0031511915   .0185418746             0{txt}  {c |}
  31    {res}.0216930661   .0216930661   .0216930661   .0031511915   .0216930661             0{txt}  {c |}
  32    {res}.0216930661   .0216930661   .0216930661   .0031511915   .0216930661   .0015755957{txt}  {c |}
  33    {res}.0201174704   .0201174704   .0201174704   .0031511915   .0201174704   .0015755957{txt}  {c |}
  34    {res}.0232686618   .0232686618   .0232686618   .0031511915   .0232686618   .0015755957{txt}  {c |}
  35    {res}.2115320665   .2284983454   .0031511915             0   .0031511915             0{txt}  {c |}
  36    {res}.0741674985   .2269227496   .0185418746   .0031511915   .0185418746             0{txt}  {c |}
  37    {res}.2269227496   .0958605646   .0185418746   .0031511915   .0185418746             0{txt}  {c |}
  38    {res}.0185418746   .0185418746   .0524744324   .1851122132   .2005028963             0{txt}  {c |}
  39    {res}.0031511915   .0031511915   .1851122132   .0339325578   .1851122132             0{txt}  {c |}
  40    {res}.0185418746   .0185418746   .2005028963   .1851122132   .0524744324             0{txt}  {c |}
  41    {res}          0             0             0             0             0   .0153906831{txt}  {c |}
      {hline 85}{c BRC}

{com}. 
. preserve
{txt}
{com}.         clear
{txt}
{com}.         getmata (pd*)=europe3
{res}{txt}
{com}.         egen total_effect = rowtotal(pd*)
{txt}
{com}.         egen max_effect = rowmax(pd*)
{txt}
{com}.         svmat ccode
{txt}
{com}.         levelsof ccode, local(C)
{res}{txt}200 205 210 211 212 220 225 230 235 255 290 305 310 316 317 325 338 339 341 343 344 346 349 350 352 355 359 360 365 366 367 368 369 370 371 372 373 375 380 385 390

{com}.         
.         gen max_country = .
{txt}(41 missing values generated)

{com}.         qui foreach n of numlist 1(1)41 {c -(}
{txt}
{com}.         
.         gsort -total_effect
{txt}
{com}.         list ccode total_effect max_country max_effect
{txt}
     {c TLC}{hline 8}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c TRC}
     {c |} {res}ccode1   total_~t   max_co~y   max_ef~t {txt}{c |}
     {c LT}{hline 8}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
  1. {c |} {res}   365   2.743095        370   .2612206 {txt}{c |}
  2. {c |} {res}   255   2.389645        220   .2395275 {txt}{c |}
  3. {c |} {res}   290   2.185087        365   .2489811 {txt}{c |}
  4. {c |} {res}   369   2.064017        290   .2379519 {txt}{c |}
  5. {c |} {res}   305   1.992635        255   .2257124 {txt}{c |}
     {c LT}{hline 8}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
  6. {c |} {res}   310   1.676999        305   .2178344 {txt}{c |}
  7. {c |} {res}   220   1.579198        255   .2395275 {txt}{c |}
  8. {c |} {res}   370   1.575873        365   .2612206 {txt}{c |}
  9. {c |} {res}   317   1.565209        290     .21941 {txt}{c |}
 10. {c |} {res}   316   1.313077        255   .2162589 {txt}{c |}
     {c LT}{hline 8}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 11. {c |} {res}   368   1.269691        365   .2442543 {txt}{c |}
 12. {c |} {res}   225   1.238179        255     .21941 {txt}{c |}
 13. {c |} {res}   367   1.153348        365   .2411031 {txt}{c |}
 14. {c |} {res}   325   1.140743        305   .2146833 {txt}{c |}
 15. {c |} {res}   349   1.109596        305   .2131077 {txt}{c |}
     {c LT}{hline 8}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 16. {c |} {res}   211   1.106445        255   .2316495 {txt}{c |}
 17. {c |} {res}   360   1.075664        369   .2099565 {txt}{c |}
 18. {c |} {res}   373    1.00653        371   .2284983 {txt}{c |}
 19. {c |} {res}   372   .9615678        373   .2269228 {txt}{c |}
 20. {c |} {res}   212   .9103035        255   .2162589 {txt}{c |}
     {c LT}{hline 8}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 21. {c |} {res}   355   .8200149        350   .2052297 {txt}{c |}
 22. {c |} {res}   375   .8188046        365   .2024438 {txt}{c |}
 23. {c |} {res}   385   .8188046        365   .2024438 {txt}{c |}
 24. {c |} {res}   350   .7734776        355   .2052297 {txt}{c |}
 25. {c |} {res}   344   .7383347        310   .1914146 {txt}{c |}
     {c LT}{hline 8}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 26. {c |} {res}   343   .6653775        350   .2036541 {txt}{c |}
 27. {c |} {res}   371   .6510239        373   .2284983 {txt}{c |}
 28. {c |} {res}   366   .6415703        365   .2024438 {txt}{c |}
 29. {c |} {res}   210   .6151504        255   .1961414 {txt}{c |}
 30. {c |} {res}   359   .5827935        369   .1914146 {txt}{c |}
     {c LT}{hline 8}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 31. {c |} {res}   230   .4940804        220   .1744483 {txt}{c |}
 32. {c |} {res}   380   .4632991        385   .1851122 {txt}{c |}
 33. {c |} {res}   339   .4506943        350   .1866878 {txt}{c |}
 34. {c |} {res}   390   .3602323        255   .1760239 {txt}{c |}
 35. {c |} {res}   346   .2253471        344   .1665703 {txt}{c |}
     {c LT}{hline 8}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 36. {c |} {res}   235   .2052297        230   .1665703 {txt}{c |}
 37. {c |} {res}   200   .1788098        205   .1634191 {txt}{c |}
 38. {c |} {res}   205   .1788098        200   .1634191 {txt}{c |}
 39. {c |} {res}   352   .1175536        373   .0201175 {txt}{c |}
 40. {c |} {res}   341          0        390          0 {txt}{c |}
     {c LT}{hline 8}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 41. {c |} {res}   338          0        390          0 {txt}{c |}
     {c BLC}{hline 8}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c BRC}

{com}.         
.         save "Results\Substantive Effects\Europe War Illustration.dta", replace
{txt}(note: file Results\Substantive Effects\Europe War Illustration.dta not found)
file Results\Substantive Effects\Europe War Illustration.dta saved

{com}. restore 
{txt}
{com}. 
. * Open up the shapefile; this will create two new datasets in the working directory (World.dta and Worldcoord.dta)
. use "Results\Substantive Effects\Europe War Illustration.dta", clear
{txt}
{com}. rename ccode1 ccode
{res}{txt}
{com}. 
. cap erase World.dta
{txt}
{com}. cap erase Worldcoord.dta
{txt}
{com}. shp2dta using "Data\Map\wg2002worldmap", database(World) coordinates(Worldcoord) genid(id)      
{res}type: 5
{txt}
{com}. 
. preserve
{txt}
{com}.         use World.dta, clear
{txt}
{com}.         rename CNTRY_NAME country_name
{res}{txt}
{com}.         gen ccode = .
{txt}(190 missing values generated)

{com}.         replace ccode = 200 if country_name == "United Kingdom"
{txt}(1 real change made)

{com}.         replace ccode = 205 if country_name == "Ireland"
{txt}(1 real change made)

{com}.         replace ccode = 210 if country_name == "Netherlands"
{txt}(1 real change made)

{com}.         replace ccode = 211 if country_name == "Belgium"
{txt}(1 real change made)

{com}.         replace ccode = 212 if country_name == "Luxembourg"
{txt}(1 real change made)

{com}.         replace ccode = 220 if country_name == "France"
{txt}(1 real change made)

{com}.         replace ccode = 225 if country_name == "Switzerland"
{txt}(1 real change made)

{com}.         replace ccode = 230 if country_name == "Spain"
{txt}(1 real change made)

{com}.         replace ccode = 235 if country_name == "Portugal"
{txt}(1 real change made)

{com}.         replace ccode = 255 if country_name == "Germany"
{txt}(1 real change made)

{com}.         replace ccode = 290 if country_name == "Poland"
{txt}(1 real change made)

{com}.         replace ccode = 305 if country_name == "Austria"
{txt}(1 real change made)

{com}.         replace ccode = 310 if country_name == "Hungary"
{txt}(1 real change made)

{com}.         replace ccode = 316 if country_name == "Czech Republic"
{txt}(1 real change made)

{com}.         replace ccode = 317 if country_name == "Slovakia"
{txt}(1 real change made)

{com}.         replace ccode = 325 if country_name == "Italy"
{txt}(1 real change made)

{com}.         replace ccode = 338 if country_name == "Malta"
{txt}(1 real change made)

{com}.         replace ccode = 339 if country_name == "Albania"
{txt}(1 real change made)

{com}.         replace ccode = 341 if country_name == "Montenegro"
{txt}(1 real change made)

{com}.         replace ccode = 343 if country_name == "Macedonia"
{txt}(1 real change made)

{com}.         replace ccode = 344 if country_name == "Croatia"
{txt}(1 real change made)

{com}.         replace ccode = 346 if country_name == "Bosnia and Herzegovina"
{txt}(1 real change made)

{com}.         replace ccode = 349 if country_name == "Slovenia"
{txt}(1 real change made)

{com}.         replace ccode = 350 if country_name == "Greece"
{txt}(1 real change made)

{com}.         replace ccode = 352 if country_name == "Cyprus"
{txt}(1 real change made)

{com}.         replace ccode = 355 if country_name == "Bulgaria"
{txt}(1 real change made)

{com}.         replace ccode = 359 if country_name == "Moldova"
{txt}(1 real change made)

{com}.         replace ccode = 360 if country_name == "Romania"
{txt}(1 real change made)

{com}.         replace ccode = 365 if country_name == "Russia"
{txt}(1 real change made)

{com}.         replace ccode = 366 if country_name == "Estonia"
{txt}(1 real change made)

{com}.         replace ccode = 367 if country_name == "Latvia"
{txt}(1 real change made)

{com}.         replace ccode = 368 if country_name == "Lithuania"
{txt}(1 real change made)

{com}.         replace ccode = 369 if country_name == "Ukraine"
{txt}(1 real change made)

{com}.         replace ccode = 370 if country_name == "Byelarus"
{txt}(1 real change made)

{com}.         replace ccode = 371 if country_name == "Armenia"
{txt}(1 real change made)

{com}.         replace ccode = 372 if country_name == "Georgia"
{txt}(1 real change made)

{com}.         replace ccode = 373 if country_name == "Azerbaijan"
{txt}(1 real change made)

{com}.         replace ccode = 375 if country_name == "Finland"
{txt}(1 real change made)

{com}.         replace ccode = 380 if country_name == "Sweden"
{txt}(1 real change made)

{com}.         replace ccode = 385 if country_name == "Norway"
{txt}(1 real change made)

{com}.         replace ccode = 390 if country_name == "Denmark"
{txt}(1 real change made)

{com}.         
.         keep if !missing(ccode)
{txt}(149 observations deleted)

{com}.         sort ccode
{txt}
{com}.         save World.dta, replace 
{txt}file World.dta saved

{com}. restore
{txt}
{com}. 
. *** Merge in the data
. sort ccode
{txt}
{com}. merge ccode using World.dta
{txt}{p}
(note: you are using old
{bf:merge} syntax; see
{bf:{help merge:[D] merge}} for new syntax)
{p_end}

{com}. tab _merge

     {txt}_merge {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          3 {c |}{res}         41      100.00      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}         41      100.00
{txt}
{com}. drop if _merge == 2
{txt}(0 observations deleted)

{com}. drop _merge
{txt}
{com}. 
. *** Produce the map (excluding Russia)
. spmap total_effect using Worldcoord if ccode != 365, id(id) fcolor(Blues)
{res}{txt}
{com}. 
. 
. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\williamslaro\Documents\Research\Projects\Spatial Methods\Spatial-X\Journal of Politics\Replication\Application\Results\Military Spending--Results.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res} 5 Sep 2019, 09:39:09
{txt}{.-}
{smcl}
{txt}{sf}{ul off}